tear (one's) hair out

Translations
рвать на (себе) волосы
After the project failed, she was tearing her hair out trying to figure out what went wrong.
После провала проекта она рвала на себе волосы, пытаясь понять, что пошло не так.
Definitions
To be extremely worried, frustrated, or anxious about something, often to the point of desperation or exasperation.